Computer science Lesson Plan
Class: 7th - Lesson:11 Debugging

Purpose: Students should learn how to identify and correct errors (bugs) in scratch projects. Debugging helps improve logical thinking, attention to detail, and resilience in solving problems.

No. of Classes

One or two classes (Teacher's decision).

Materials Required

Scratch 3.0

Curriculum Content
  • 2.16) Debugging
  • Prior knowledge

    Familiarity with all the Scratch concepts taught so far (Events, Loops, Variables, Clones, Custom Blocks…).

    Exercises

    Exercise:1



  • Correct the following fruit catching game, in which the fruits are stored in the bottom. You have to delete them.
  • Exercise:2



  • Use the below link to download the program which has bugs and try to debug the code. See the video to understand what is the bug in the program.
  • Solutions



  • Link to copy solution program for exercise-1.
  • Link to copy solution program for exercise-2.

  • Teacher's Instruction
    1. Introduce the term bug and explain it as a mistake or unexpected behavior in a program.
    2. Teach how to read code step-by-step.
    3. Explain strategies like: Checking variables, using the green flag to reset, breaking down large scripts into smaller parts to check if the different portions are working.
    4. Encourage students to predict what a script should do, compare with what it does, then trace the error.
    5. Allow students to work in pairs for peer-debugging.
    6. Ask them to think about what are some things they can do to reduce or avoid bugs.